package com.lj.generator.result.gen;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.lj.generator.constant.GenConstant;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * @author luojing
 * @since 2025/1/21 15:45
 */
@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
public class OperateDrawerInfo extends AbstractTemplateInfo {
    public OperateDrawerInfo(GenTemplateInfo genTemplateInfo) {
        super(genTemplateInfo);
        setFileName(genTemplateInfo.getEntity().getClassName() + "OperateDrawer" + GenConstant.vueFileSuffix);
        List<String> filePath = CollUtil.newArrayList(GenConstant.frontEndDir);
        filePath.addAll(GenConstant.viewsDir);
        filePath.add(genTemplateInfo.getModuleName());
        filePath.add(StrUtil.lowerFirst(genTemplateInfo.getEntity().getClassName()));
        setFilePath(filePath);
    }

    @Override
    public String getTemplate() {
        return GenConstant.operateDrawerTemplate;
    }
}
